﻿using vroom.wcf.dal;
using vroom.wcf.protobuf.service.common;
using vroom.wcf.service.protobuf;
using vroom.wcf.service.protobuf.pocos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;

namespace vroom.wcf.protobuf.service
{
	public class PosProtobufService : IPosService
	{
		
		public Bucket[] GetBucketedPositions(DateTime effectiveDate)
		{
			Bucket[] res = null;

			PosDataAccess dal = new PosDataAccess();
			res = dal.GetBucketedPositions(effectiveDate)
					 //.Take(100)
					 .Select
					(
						p => new Bucket()
						{

							PosId = p.PosId,
							Date = p.Date,
                            Grouper = p.Grouper,
                            val1 = p.Val1,
                            val2 = p.Val2
						}
					).ToArray();

			return res;
		}
	}
}
